﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;

namespace TPCN.DAL
{
   public class MenuObj
    {
        private string _MenuID;

        public string MenuID
        {
            get { return _MenuID; }
            set { _MenuID = value; }
        }
        private string _Name;

        public string Name
        {
            get { return _Name; }
            set { _Name = value; }
        }
        private string _Url;

        public string Url
        {
            get { return _Url; }
            set { _Url = value; }
        }
        private string _Keyword;

        public string Keyword
        {
            get { return _Keyword; }
            set { _Keyword = value; }
        }
        private string _Description;

        public string Description
        {
            get { return _Description; }
            set { _Description = value; }
        }
        private string _Title;

        public string Title
        {
            get { return _Title; }
            set { _Title = value; }
        }
        private string _Type;

        public string Type
        {
            get { return _Type; }
            set { _Type = value; }
        }
        private string _Content;

        public string Content
        {
            get { return _Content; }
            set { _Content = value; }
        }
        private string _Link;

        public string Link
        {
            get { return _Link; }
            set { _Link = value; }
        }
        private string _Position;

        public string Position
        {
            get { return _Position; }
            set { _Position = value; }
        }
        private string _Order;

        public string Order
        {
            get { return _Order; }
            set { _Order = value; }
        }
        private string _Active;

        public string Active
        {
            get { return _Active; }
            set { _Active = value; }
        }
        private string _Target;

        public string Target
        {
            get { return _Target; }
            set { _Target = value; }
        }
        private string _ParentID;

        public string ParentID
        {
            get { return _ParentID; }
            set { _ParentID = value; }
        }
        public MenuObj SetValuesFromDataReader(IDataReader reader)
        {
            MenuObj obj = new MenuObj();
            obj.MenuID = (reader["MenuID"] is DBNull) ? String.Empty : reader["MenuID"].ToString();
            obj.Name = (reader["Name"] is DBNull) ? String.Empty : reader["Name"].ToString();
            obj.Url = (reader["Url"] is DBNull) ? String.Empty : reader["Url"].ToString();
            obj.Keyword = (reader["Keyword"] is DBNull) ? String.Empty : reader["Keyword"].ToString();
            obj.Description = (reader["Description"] is DBNull) ? String.Empty : reader["Description"].ToString();
            obj.Title = (reader["Title"] is DBNull) ? String.Empty : reader["Title"].ToString();
            obj.Type = (reader["Type"] is DBNull) ? String.Empty : reader["Type"].ToString();
            obj.Content = (reader["Content"] is DBNull) ? String.Empty : reader["Content"].ToString();
            obj.Link = (reader["Link"] is DBNull) ? String.Empty : reader["Link"].ToString();
            obj.Position = (reader["Position"] is DBNull) ? String.Empty : reader["Position"].ToString();
            obj.Order = (reader["Order"] is DBNull) ? String.Empty : reader["Order"].ToString();
            obj.Active = (reader["Active"] is DBNull) ? "False" : reader["Active"].ToString();
            obj.Target = (reader["Target"] is DBNull) ? String.Empty : reader["Target"].ToString();
            obj.ParentID = (reader["ParentID"] is DBNull) ? String.Empty : reader["ParentID"].ToString();
            return obj;
        }
    }
}
